<?php
 

define('IN_SCRIPT',1);

/* Get all the required files and functions */
require_once('hd_settings.inc.php');
require_once('language/'.$hd_settings['language'].'.inc.php');
require_once('inc/common.inc.php');
hd_session_start();
hd_isLoggedIn();

/* Print header */
require_once('inc/header.inc.php');

$trackingID=strtoupper(hd_input($_GET['track'],"$hdlang[int_error]: $hdlang[no_trackID]."));
if ($_GET['archived']) {$status=1; $action=$hdlang['added_archive']; $action2=$hdlang['added2archive'];}
else {$status=0; $action=$hdlang['removed_archive']; $action2=$hdlang['removedfromarchive'];}

/* Connect to database */
require_once('inc/database.inc.php');
hd_dbConnect() or hd_error("$hdlang[cant_connect_db] $hdlang[contact_webmsater] $hd_settings[webmaster_mail]!");

$sql = "UPDATE `hd_requests` SET `archive`='$status' WHERE `requestid`='$trackingID' LIMIT 1";
$result = hd_dbQuery($sql) or hd_error("$hdlang[cant_sql]: $sql</p><p>$hdlang[mysql_said]:<br>".mysql_error()."</p><p>$hdlang[contact_webmsater] $hd_settings[webmaster_mail]");

$admin_trackingURL=$hd_settings['hd_url'].'/admin_request.php?track='.$trackingID.'&Refresh='.rand(10000,99999);

/* Print admin navigation */
require_once('inc/show_admin_nav.inc.php');
?>

</td>
</tr>
<tr>
<td>

<p>&nbsp;</p>
<h3 align="center"><?php echo $action; ?></h3>

<p>&nbsp;</p>

<p align="center"> <?php echo $action2; ?>!</p>

<p align="center"><a href="<?php echo $admin_trackingURL; ?>"><?php echo $hdlang['view_request']; ?></a> |
<a href="admin_main.php"><?php echo $hdlang['main_page']; ?></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>

<!-- HR -->
<p>&nbsp;</p>

<?php
require_once('inc/footer.inc.php');
exit();

?>
